﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace RISMOTAXDP.EmailService
{
    public static class MailTemplateObject
    {
        #region 邮件模板变量

        #region 账号
        /// <summary>
        /// 账号的姓名
        /// </summary>
        public const string MemberName = "$MemberName$";
        /// <summary>
        /// 账号ID
        /// </summary>
        public const string MemberID = "$MemberID$";
        /// <summary>
        /// 账号密码
        /// </summary>
        public const string MemberPassword = "$MemberPassword$";
        /// <summary>
        /// 账号到期日
        /// </summary>
        public const string MemberExpireDay = "$MemberExpireDay$";
        /// <summary>
        /// 重置密码URL
        /// </summary>
        public const string ResetPasswordURL = "$ResetPasswordURL$";

        #endregion

        #region 法规解读
        /// <summary>
        /// 法规解读标题
        /// </summary>
        public const string LawCaseTitle = "$LawCaseTitle$";
        /// <summary>
        /// 法规解读作者
        /// </summary>
        public const string LawCaseWriter = "$LawCaseWriter$";
        /// <summary>
        /// 法规解读URL
        /// </summary>
        public const string LawCaseTitleURL = "$LawCaseTitleURL$";
        /// <summary>
        /// 法规解读简介
        /// </summary>
        public const string LawCaseTitleIntro = "$LawCaseIntro$";
        /// <summary>
        /// 法规解读更新日期
        /// </summary>
        public const string LawCaseDate = "$LawCaseDate$";
        
        #endregion

        #region 法规
        /// <summary>
        /// 法规标题
        /// </summary>
        public const string LawTitle = "$LawTitle$";
        /// <summary>
        /// 法规文号
        /// </summary>
        public const string LawRefNo = "$LawRefNo$";
        /// <summary>
        /// 法规ID
        /// </summary>
        public const string LawID = "$LawID$";

        public const string LawTitleURL = "$LawTitleURL$";
        /// <summary>
        /// 法规发文日期
        /// </summary>
        public const string LawDate = "$LawDate$";

        #endregion


        //[templateRepeatList][/templateRepeatList]列表显示



        #endregion

        public static RegexOptions options = RegexOptions.IgnoreCase;

        private static Regex[] regex = new Regex[20];

        public static Regex regex_RepeatList
        {
            get { return regex[0]; }
        }

        static MailTemplateObject()
        {
            regex[0] = new Regex(@"\s*\[templateRepeatList\]([\s\S]+?)\[\/templateRepeatList\]\s*");
        }


        /*
        public static List<string> ParseRepeatList(string text)
        {
            Match m;

            for (m = regex[0].Match(text); m.Success; m = m.NextMatch())
            {
                
            }


            return "";
        }
         */

    }
}
